package org.example.service;

import org.example.error.BusinessException;
import org.example.service.model.ItemModel;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * @Author itmei
 * @Package org.example.service
 * @Date 2025/6/1 11:03
 */
public interface ItemService {
    //创建商品
    ItemModel createItem(ItemModel itemModel) throws BusinessException;

    //商品列表浏览
    List<ItemModel> listItem();


    //商品详情
    ItemModel getItemById(Integer id);

    //库存扣减
   boolean decreaseStock(Integer itemId,Integer amount)throws BusinessException;

   //商品销量增加
    void increaseSales(Integer itemId,Integer amount)throws BusinessException;
    //分页查询商品列表
    List<ItemModel> listItemByPage(int pageNum,int pageSize);
    //查询热门商品
    List<ItemModel> listHotItems(int limit);
}
